Learn R Programming

SeuratObject (version 5.0.2)

[,LogMap: Matrix-like Subsetting for Logical Maps

Description

Matrix-like Subsetting for Logical Maps

Usage

# S4 method for LogMap,missing,missing,ANY
[(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,character,character,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,character,missing,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,missing,character,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,numeric,missing,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,missing,numeric,ANY [(x, i, j, ..., drop = FALSE)

# S4 method for LogMap,numeric,numeric,ANY [(x, i, j, ..., drop = FALSE)

Arguments

x

A LogMap object

i, j

Vectors of values (i) and observations (j) to pull from x

...

Arguments passed to other methods

drop

relevant for matrices and arrays. If TRUE the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement. See drop for further details.

Examples

Run this code
map <- LogMap(letters[1:10])
map[['obs']] <- c(1, 3, 7)
map[['entry']] <- c(2, 7, 10)

map[]
map[1:5, 2L]
map[c("b", "c", "f"), "obs"]

# Pass `drop = TRUE` to cast to `matrix`
map[1:3, , drop = TRUE]

# Note that `i` is non-reordable
rownames(map)[1:3]
map[c("b", "c", "a"), , drop = TRUE]

Run the code above in your browser using DataLab